package com.benhil.hrms.service;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.benhil.hrms.dao.IUserDao;
import com.benhil.hrms.model.User;
import com.benhil.hrms.util.JsonModelConverter;

@Service
public class UserService implements IUserService {

	@Autowired
	private IUserDao mUserDao;
	@Autowired
	private JsonModelConverter mConverter;
	
	@Override
	@Transactional(readOnly = true)
	public List<User> getUserList() {		
		return mUserDao.findAll();
	}

	@Override
	public List<User> create(Object data) {
		List<User> newUsers = new ArrayList<User>();
		Collection<User> list = mConverter.getModelsFromRequest(data, User.class);
		return null;
	}

	@Override
	public List<User> update(Object data) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void delete(Object data) {
		// TODO Auto-generated method stub
		
	}

}
